/**
 * 
 */
package br.com.ctm.advogadope.negocio.impl;

import java.util.List;

import javax.annotation.security.PermitAll;
import javax.ejb.Stateless;
import javax.inject.Inject;

import br.com.ctm.advogadope.dao.api.UfDao;
import br.com.ctm.advogadope.model.Uf;
import br.com.ctm.advogadope.negocio.api.UfNegocio;
import br.com.framework.negocio.impl.BaseNegocioImpl;

/**
 * @author Cleber
 *
 */
@Stateless
@PermitAll
public class UfNegocioImpl extends BaseNegocioImpl<Uf, UfDao> implements
		UfNegocio {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	public UfNegocioImpl() {
	}
	
	@Inject
	protected void setDao(UfDao dao) {
		super.setDao(dao);
	}

	@Override
	public Uf findBySigla(String sigla) {
		Uf exUF = new Uf();
		exUF.setSigla(sigla);
		List<Uf> list = findByExample(exUF, false, false);
		if (!list.isEmpty()) {
			return list.get(0);
		}
		return null;
	}


}
